<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>作为属性名的Symbol</title>
  </head>
  <body>
    <p>Symbol是独一无二的，可以作为对象属性的键</p>
    <pre>
        let mySymbol =Symbol();
        let a= {};

        a[mySymbol] = 'Hello!'
        // 或者
        a= {
          [mySymbol] = 'Hello!'
        }
    </pre>
  </body>
</html>

<script>
  let mySymbol = Symbol();
  let a = {};

  a[mySymbol] = "Hello!";
  // 或者
  a = {
    [mySymbol]: "Hello!",
  };
</script>
